package com.acme.task2;

public class Foo {
	final static String outBefore = "finalize() was called at ";
	final static String outAfter = " iteration";

	private int iterNumber = -1;

	Foo(int iterNumber) {
		this.iterNumber = iterNumber;
	}

	@Override
	protected void finalize() throws Throwable {
		// print to console that finalize() was called
		System.out.println(outBefore + iterNumber + outAfter);
		super.finalize();
	}
}
